﻿@using SDK.Authorization

<AuthorizeView>
    <NotAuthorized>
        <MudLink Href="Identity/Account/Login" Underline="Underline.None" Class="noprint">
            Login
        </MudLink>
    </NotAuthorized>
    <Authorized>
        <MudMenu Class="noprint">
            <ActivatorContent>
                <MudTooltip Text="@_username">
                    <MudAvatar Color="Color.Primary">@_avatar</MudAvatar>
                </MudTooltip>
            </ActivatorContent>
            <ChildContent>
                <AuthorizeView Roles="@Roles.Administrator" Context="innerContext">
                    <MudLink Href="admin/usermanagement" Underline="Underline.None">
                        <MudMenuItem Icon="@Icons.Material.Filled.AdminPanelSettings">
                            Administration
                        </MudMenuItem>
                    </MudLink>
                </AuthorizeView>
                <MudLink Href="Identity/Account/Manage/ChangePassword" Underline="Underline.None">
                    <MudMenuItem Icon="@Icons.Material.Filled.Password">
                        Change password
                    </MudMenuItem>
                </MudLink>
                <MudMenuItem Icon="@Icons.Material.Filled.Logout" OnClick="@Logout">
                    Log out
                </MudMenuItem>
            </ChildContent>
        </MudMenu>
    </Authorized>
</AuthorizeView>
